import type { RouteRecordRaw } from "vue-router";
export const Layout = () => import("@/layout/index.vue")
export const staticRoutes: Array<RouteRecordRaw> = [
    {
      path: "/login",
      name: "Login",
      component: () => import("@/views/login/index.vue"),
      meta: {
        isShow: false,
        title:'登录'
      },
    },
    {
      path: "/404",
      name: "404",
      meta: { title: "404", isShow: false },
      component: () => import("@/views/404/index.vue"),
    },
    {
      path: '/redirect/:path(.*)',
      name: 'redirect',
      meta: { title: "重定向", isShow: false },
      component: () => import('@/views/redirect/index.vue')
    }
]

/**
 * 动态路由
 * 
 */
export const allAsyncRoutes = [
     {
        path: '/',
        name: 'rootAi',
        component: Layout,
        redirect: '/ai',
        children:[
            {
                path: '/ai',
                name: 'Ai',
                component: () => import('@/views/ai/index.vue'),
                meta: { title: "AI", isShow: true },
            }
        ]
     },
     {
        path: '/',
        name: 'rootMyXterm',
        component: Layout,
        redirect: '/terminal',
        children:[
            {
                path: '/terminal',
                name: 'MyXterm',
                component: () => import('@/views/myXterm/index.vue'),
                meta: { title: "SSH", isShow: true },
            }
        ]
     },
     {
      path:"/",
      name:"electronTest",
      component:Layout,
      children:[
        {
          path:"/electronTest",
          name:"ElectronTest",
          component:()=>import("@/views/electronTest/index.vue")
        }
      ]
     },
     {
      path:"/",
      name:"xftp",
      component:Layout,
      children:[
        {
          path:"/xftp",
          name:"Xftp",
          component:()=>import("@/views/xftp/index.vue")
        }
      ]  
     }
  ]


  /***
 * @任意路由
 */
export const anyRouter = [
    {
      path: "/:pathMatch(.*)*",
      name: 'Any',
      meta: { title: "任意路由", isShow: false },
      redirect: "/404",
    },
  ]